/**
 * (created at 2011-2-18)
 */
package qiushuo.mysqlparser.ast.statement;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import qiushuo.mysqlparser.ast.expression.Expression;

/**
 * @author <a href="mailto:QiuShuo1985@gmail.com">QIU Shuo</a>
 */
public class DMLCallStatement extends DMLStatement {
    private final String procedureName;
    private final List<Expression> arguments;

    /**
     * @param procedureName
     * @param arguments
     */
    public DMLCallStatement(String procedureName, List<Expression> arguments) {
        super();
        this.procedureName = procedureName;
        if (arguments == null || arguments.isEmpty()) {
            this.arguments = Collections.emptyList();
        } else if (arguments instanceof ArrayList) {
            this.arguments = arguments;
        } else {
            this.arguments = new ArrayList<Expression>(arguments);
        }
    }
}
